/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package BUS;

import DAO.MonAn_DAO;
import DTO.MonAn_DTO;
import javax.swing.table.DefaultTableModel;

/**
 *
 * @author PEKEM
 */
public class MonAn_BUS {

    public static DefaultTableModel layBangMonAn() throws Exception {
        return MonAn_DAO.layBangMonAn();
    }

    public static int Insert(MonAn_DTO m) throws Exception {
        return MonAn_DAO.Insert(m);
    }

    public static int Delete(String maMonAn) throws Exception {
        return MonAn_DAO.Delete(maMonAn);
    }

    public static int Update(MonAn_DTO m) throws Exception {
        return MonAn_DAO.Update(m);
    }

    public static String layMaCuoiCung() throws Exception {
        return MonAn_DAO.layMaCuoiCung();
    }

    public static String taoMaTuDong(String maGoc, int batDau) throws Exception {
        return MonAn_DAO.taoMaTuDong(maGoc, batDau);
    }

    public static DefaultTableModel layBangMonAnTheoTen(String ten) throws Exception {
        return MonAn_DAO.layBangMonAnTheoTen(ten);
    }

    public static DefaultTableModel layBangMonAnTheoDonGia(Float tu, Float den) throws Exception {
        return MonAn_DAO.layBangMonAnTheoDonGia(tu, den);
    }
    public static boolean kiemTraMonAnCoTrongCTPhieuDatTiec(String mamon) throws Exception {
        return MonAn_DAO.kiemTraMonAnCoTrongCTPhieuDatTiec(mamon);
    }
}
